function resourceRouting($stateProvider){
    $stateProvider.state('resource', {
        url: '/',
        template: require('./resource.html'),
        controller: 'ResourceController as rc',
        resolve: {
            loadResourceController: ($q, $ocLazyLoad) => {
                return $q((resolve) => {
                    require.ensure([], () => {
                        // load whole module
                        let module = require('./resource.index');
                        $ocLazyLoad.load({name: module.name});
                        resolve(module.controller);
                    });
                });
            }
        }
    });
}

export default angular.module('resource.routing', []).config(resourceRouting).name;